package org.ysu.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.minio.errors.*;
import org.springframework.web.multipart.MultipartFile;
import org.ysu.entity.Admin;
import com.baomidou.mybatisplus.extension.service.IService;
import org.ysu.vo.LoginVO;

import javax.mail.MessagingException;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * <p>
 * 管理员表 服务类
 * </p>
 *
 * @author LiuShuo
 * @since 2024-08-14
 */
public interface AdminService extends IService<Admin> {
    List<Admin> getList();
    boolean check(Long id,String field,String value);
    boolean add(String name, Integer sex, String phone, String idcard, String email, String password,  Long areaId, MultipartFile file) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException ;
    boolean update(Long id, String name, Long areaId, String phone, Integer sex, String idcard, String email,  MultipartFile file) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;
    boolean del(Long id,Boolean status);
    List<String> getNameByAdminId(Long adminId);
    LoginVO login(String username, String password);
    boolean sendCode(String email) throws MessagingException;
    boolean checkCode(String email,String code);
    boolean register(String name, Integer sex, String idcard, String phone,String email, String password, Long areaId) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException ;
    IPage<Admin> list(Integer pageNo, Integer pageSize, String val);
    List<Admin> Verifier();
    Admin getOne(Long id);
    Boolean change(String email,String password);
}
